<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/init.jsp" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ page import="org.apache.shiro.authc.ExcessiveAttemptsException"%>
<%@ page import="org.apache.shiro.authc.IncorrectCredentialsException"%>
<!DOCTYPE html>
<html>
	<head>
  <cui:import widgetString="base,bootstrap,font,app"></cui:import>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>server App</title>
	<link rel="stylesheet" type="text/css" href="/static/cui/login/login.css">
	<link rel="stylesheet" type="text/css" href="/static/cui/login/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="/static/cui/font-awesome-4.4.0/css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="/static/cui/login/icon.css">
	<link rel="shortcut icon" href=" /favicon.ico" /> 
	<script type="text/javascript" src="/static/cui/login/json2.js"></script>
	<script type="text/javascript" src="/static/cui/login/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="/static/cui/login/jquery.backstretch.min.js"></script>
	<script type="text/javascript" src="/static/cui/login/bootstrap.min.js"></script>
	
  <script type="text/javascript">
  
  //用于处理登陆过期（cookie）
  if(window.top.document.referrer != ""){
	  var str = window.parent.location.href;
	  if(window.parent.location.href.indexOf("/login")<0){
		  window.parent.location.href = "/login";
	  }
  }
  </script>
	</head>
	<body  style="background:#396160 url('/static/cui/login/smarter-login-img.jpg') center center  no-repeat;">
		<form id="loginForm" action="${ctx}/login" method="post" class="panel-body">
		<div class="logo">
			<div>
				<img src="/static/cui/login/logo.png">
			</div>
<!-- 			<h3 style="color: white;">Smart.APP V0.9</h3> -->
		</div>
		<div class="content">
			<div class="form-group">
				<div class="input-icon">
					<i class="fa fa-user"></i> 
						<input id="username"
						class="form-control placeholder-no-fix" type="text" value=""
						name="username" placeholder="账号" autocomplete="off">
				</div>
			</div>
			<div class="form-group">
				<div class="input-icon">
					<i class="fa fa-lock"></i> <input
						class="form-control placeholder-no-fix" type="password"
						autocomplete="off" placeholder="请输入密码" id="password"
						name="password">
				</div>
			</div>
			<div id="tip" class="error-message">
				<c:set var="errorKey" value="${shiroLoginFailure}"/>
				<c:if test="${!empty errorKey}">
						<c:choose>
							<c:when test="${errorKey eq  'org.apache.shiro.authc.UnknownAccountException'}">用户名错误！</c:when>
							<c:when test="${errorKey eq  'org.apache.shiro.authc.IncorrectCredentialsException'}">密码错误！</c:when>
							<c:when test="${errorKey eq  'org.apache.shiro.authc.AuthenticationException'}">认证失败！</c:when>
							<c:when test="${errorKey eq  'org.apache.shiro.authc.ExcessiveAttemptsException'}">密码错误次数超过限制！</c:when>
							
							<c:otherwise>${errorKey}</c:otherwise>
						</c:choose>
				</c:if>
			</div>
			<div class="form-group button-div" >
				<a href="javascript:void(0);" style="float: right; color: #000; height: 40px; line-height: 40px; color: #fff;">忘记密码？</a>
			</div>
			<div class="form-group button-div" >
				<input type="submit" value="登录" class="but">
			</div>
		</div>
		<div class="hiddenDiv"></div>
	<!-- 
		<div class="backstretch">
		</div> -->
		</form>
	</body>
</html>
